package com.xx.design.exception.ass;


/**
 * @author EDY
 * 所有的异常断言对象，后续可根据异常类中的增加而扩展
 */
public enum Asserts implements Assert {

    /**
     * 业务异常的断言对象
     */
    BUSINESS_ASSERT(new BusinessExceptionAssert()),

    /**
     * 授权异常断言对象
     */
    AUTH_ASSERT(new UnauthorizedExceptionAssert());

    Assert ass;

    Asserts(Assert azz) {
        this.ass = azz;
    }

    @Override
    public void assertNotNull(Object obj, String message) {
        this.ass.assertNotNull(obj, message);
    }

    @Override
    public void assertNull(Object obj, String message) {
        this.ass.assertNull(obj, message);
    }

    @Override
    public void assertTrue(Boolean bool, String message) {
        this.ass.assertTrue(bool, message);
    }
}
